package cn.usian.jyzx.common.util;

import cn.usian.jyzx.model.entity.user.UserInfo;

/**
 * @TODO:
 * @Author:baimu
 * @Date:2024 11 06 14 18
 **/
public class UserInfoThreadLocalUtil {

    private static final ThreadLocal<UserInfo> THREAD_LOCAL = new ThreadLocal<>();

    public static void setUserInfo(UserInfo userInfo) {
        THREAD_LOCAL.set(userInfo);
    }

    public static UserInfo getUserInfo() {
        return THREAD_LOCAL.get();
    }

    public static void remove() {
        THREAD_LOCAL.remove();
    }
}
